#ifndef FORMMAINLIST_H
#define FORMMAINLIST_H

#include <QWidget>
#include <QDebug>
#include <QLayout>
#include "listeclientmodel.h"
#include "listeclienttableview.h"
#include "formclient.h"
#include "mysortfilterproxymodel.h"
#include <QDesktopWidget>
#include "databasemanager.h"
#include "laddatabasemanager.h"

namespace Ui {
class FormMainList;
}

class FormMainList : public QWidget
{
    Q_OBJECT
    
public:
    explicit FormMainList(databaseManager &datab, ListeClient &listeClient,QStringList &listeTypeClient, ListeTypePrestation &listeTypePrestation, QWidget *parent = 0);
    ~FormMainList();

    void setFiltre(QString fTypeClient ,QString fDepartement, QString fGeneral);

public slots:
    void ReceptionClient(Client *client);

    void SelectionClient(QModelIndex index);

    void Filtre(QString f);
    void ChoixFiltre();
    void ChoixTypeClient(QString typeClient);
    void ChoixDepartement(QString departement);
    void Sort(int index);
    void Affichage();

signals:
    void EnvoiClient(Client *client);

private:
    Ui::FormMainList *ui;

    ListeClient *m_listeClient;
    ListeClientModel *m_modelTableView;
    MySortFilterProxyModel *proxyModel;
    QStringList *m_listeTypeClient;
    ListeTypePrestation *m_listeTypePrestation;
    databaseManager *db;
    ladDatabaseManager ladDb;

    FormClient *m_formClient;
    QVBoxLayout* layout;

    QString filtre;
    QString filtreDepartement;
    QString filtreTypeClient;

};

#endif // FORMMAINLIST_H
